using System.Collections.Generic;
using Avalonia.Controls;
using Avalonia.Threading;
using JMClient.ViewModels;
using JMClient.ViewModels.ControlsLib;
using JMClient.Models.Common;

namespace JMClient.Views.ControlsLib
{
    public partial class NavSlider : UserControl
    {
        public NavSlider(NavSliderViewModel viewModel )
        {
            InitializeComponent();
            this.DataContext = viewModel;
            //默认播放第一个
            Dispatcher.UIThread.InvokeAsync(() =>
            {
                if (NavListBox.Items?.Count > 0)
                {
                    NavListBox.SelectedIndex = 0;
                }
            });
     
        }

        private void SelectingItemsControl_OnSelectionChanged(object? sender, SelectionChangedEventArgs e)
        {

        }
    }
}